package com.xzzz.backend.bsms.server.base.yuque;

import com.xzzz.backend.bsms.server.base.yuque.pojo.UserRes;
import com.xzzz.common.base.pojo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * 语雀接口
 * @apiNote 接入语雀 OPEN_API
 */
@RestController
@RequestMapping("/yuque")
public class YuqueController {

    @Autowired
    private YuqueFeign yuqueFeign;

    /**
     * 获取语雀用户
     *
     * @return 语雀用户集合
     */
    @GetMapping("/users")
    public R<List<UserRes>> getUsers() {
        List<UserRes> users = new ArrayList<>();

        R<UserRes> user = yuqueFeign.user();

        users.add(user.getData());
        return R.ok(users);
    }
}

